<%@page import="ll.sms.web.*"%><%@ page language="java" import="ll.sms.pojo.*" pageEncoding="UTF-8"%>
<%@page import="ll.sms.util.*"%>

<%


String sort = ParamUtils.getParameter(request,"sort");
int index = ParamUtils.getIntParameter(request,"start",0);
int pageSize = ParamUtils.getIntParameter(request,"limit",15);
int currentPage = 1+(index/pageSize);
String proxyUname = ParamUtils.getParameter(request,"pid");
String condition  = null;

proxyUname = proxyUname==null?"":new String(proxyUname.getBytes("ISO-8859-1"),"GBK"); //注意是GBK，与工程编码有关

if("userflag".equals(request.getParameter("userflag"))){
condition  = " where cuname = '"+proxyUname+"' and coperator !='admin'";
}else{
condition  = " where cuname = '"+proxyUname+"' and coperator ='admin'";
}
int total = WebBusinessImpl.getInstance().countTable("sms_account",condition);

String dir = request.getParameter("dir");
if(dir == null){
	dir = "ASC";
}

String orderStr = null;
if(sort != null && !sort.equals("")){
	orderStr = " "+sort+" "+dir+" ";
}

String s = ExtJsonBuilder.toExtJsonString(total,  WebBusinessImpl.getInstance().pageQuery(SmsAccount.class,"sms_account",condition,currentPage,pageSize,orderStr));
response.getWriter().print(s);
%>
